﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Rex.Assignment.Application.AppUsers;
using Rex.Assignment.Application.AppUsers.Dtos;
using Rex.Assignment.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Rex.Assignment.WebApi.Controllers
{
    [Route("api/SysUser")]
    [ApiController]
    public class SysUserController : ControllerBase
    {
        private readonly IUserAppService _userAppService;

        public SysUserController(IUserAppService userAppService)
        {
            _userAppService = userAppService;
        }

        /// <summary>
        /// 获取用户信息
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public DataResult<IList<SysUserDto>> GetSysUserList()
        {
            var result = _userAppService.GetSysUserList<DateTime>(false, c => c.CreateDate, c => c.LoginID != null);
            return result;
        }

    }
}
